This chapter, Judges 19, is probably one of the darkest and most disturbing ones in the Bible. It clearly shows what happens when man rejects God:
“In those days there was no king in Israel. Everyone did that which was right in his own eyes.” (Judges 21:25 WEB)
When man does what is ‘right in his own eyes’, moral degradation is sure to happen because of sin in them.
The Bible doesn't portray violence and evil just to scare you or for shock factor like in horror movies. There is a purpose for it, and it's always God-centered.
In this case, we are given a frightful chapter to show what happens when man doesn't want God to be in charge.
https://www.miltongoh.net/miltons-blog/the-most-gruesome-chapter-of-the-bible